/**
* @name 底部菜单栏
* @description:
* @param
* @return
*/
<template>
	<u-tabbar :list="list" active-color="#ffcf56" icon-size="45"></u-tabbar>
</template>

<script>
	import { createNamespacedHelpers } from 'vuex'
	const { mapState } = createNamespacedHelpers('userModule')
	
	export default {
		data() {
			return {
				list: [{
						iconPath: "/static/home.png",
						selectedIconPath: "/static/home-selected.png",
						text: '首页',
						customIcon: false,
						pagePath:"/pages/home/home"
					},
					{
						iconPath: "/static/shopcar.png",
						selectedIconPath: "/static/shopcar-selected.png",
						text: '购物车',
						customIcon: false,
						pagePath:"/pages/shopcar/shopcar",
					},
					{
						iconPath: "/static/user.png",
						selectedIconPath: "/static/user-selected.png",
						text: '我的',
						customIcon: false,
						pagePath:"/pages/user/user"
					}
				]
			}
		},
		computed:{
			...mapState(["enterprise"]),
			num(){//购物车购买数量
				return this.$store.state.unSignModule.shopCarMenuList.length
			}
		},
		watch:{
			num:{
				handler(val){
					this.list[1].count = val
				},
				immediate:true,
				deep:true
			}
		},
		created(){
			if(this.enterprise.type === 1){//判断是签约还是未签约(1、签约，2、非签约)
				this.list.splice(1,1)
			}
		}
	}
</script>

<style>
</style>
